package validator;

import exceptions.InvalidLatLongCoordinatesException;

/**
 * Implements a validator of coordinates (latitude and longitude)
 * @author Alexandre, Cristovao, Raul, Rodolpho, Tales
 * @version 1.1
 * @milestone Number 2
 */
public class CoordinatesValidator {
	
	/**
	 * Validates a geography coordinate
	 * @param lat
	 * @param longi
	 * @throws InvalidLatLongCoordinatesException if the coordinates are invalid.
	 */
	public static void validateCoordinates(int lat, int longi) throws InvalidLatLongCoordinatesException{
		if ((lat > 90) || (lat < -90) || (longi < -180) || (longi > 180)) {
			throw new InvalidLatLongCoordinatesException(
					"Latitude/Longitude invalidos.");
		}
	}

}
